
clear

set more off

cd "/Users/uctqa20/Dropbox/Land&UrbanizationProject/Analysis/Replication Material"

use "harris_honig_jop_replication_data.dta"

log using "replication_jop.log"

/*
*** code to generate variables ***

*these variables are already generated and contained in the dataset, but if scholars
*what to check our coding against the raw variables, our code for generating the cleaned
*variables is here:

gen trust_pay_back = 1 if lexp_q11 == 2
replace trust_pay_back = 0 if lexp_q11 == 1
replace trust_pay_back = 0 if lexp_q11 == 3

gen help_collect_donations = 1 if lexp_q14 == 1
replace help_collect_donations = 1 if lexp_q14 == 2
replace help_collect_donations = 0 if lexp_q14 == 3
replace help_collect_donations = 0 if lexp_q14 == 4

gen exp_title = 0 if lexp_q10 == 3
replace exp_title = 0 if lexp_q10 == 4
replace exp_title = 1 if lexp_q10 == 1
replace exp_title = 1 if lexp_q10 == 2

gen exp_highinc = 1 if lexp_q9 == 1
replace exp_highinc = 0 if lexp_q9 != 1 & lexp_q9 != .

gen exp_lowinc = 1 if lexp_q9 == 3
replace exp_lowinc = 0 if lexp_q9 != 3 & lexp_q9 != .

gen exp_migrant = 1 if lexp_q8 == 2
replace exp_migrant = 0 if lexp_q8 == 1

gen exp_age50 = 1 if lexp_q7 == 2
replace exp_age50 = 0 if lexp_q7 == 1

gen exp_male = 1 if lexp_q6 == 1
replace exp_male = 0 if lexp_q6 == 2

*to code exp_co_ethnic, we can simply use lexp_q5 as is done below, but we first
*code each respondent's ethnicity to ensure lexp_q5 accurately captures whether or not
*the hypothetical neighbor is a co-ethnic or not. 

*Malawi ethnicity
tab demo_q4 if mal_border == 1

gen resp_chewa = 1 if demo_q4 == 4
replace resp_chewa = 0 if demo_q4 != 4 & demo_q4 != .

gen resp_lambya = 1 if demo_q4 == 18
replace resp_lambya = 0 if demo_q4 != 18 & demo_q4 != .

gen resp_lomwe = 1 if demo_q4 == 20
replace resp_lomwe = 0 if demo_q4 != 20 & demo_q4 != .

gen resp_manganja = 1 if demo_q4 == 28
replace resp_manganja = 0 if demo_q4 != 28 & demo_q4 != .

gen resp_ndali = 1 if demo_q4 == 34
replace resp_ndali = 0 if demo_q4 != 34 & demo_q4 != .

gen resp_ngoni = 1 if demo_q4 == 35
replace resp_ngoni = 0 if demo_q4 != 35 & demo_q4 != .

gen resp_nkhonde = 1 if demo_q4 == 37
replace resp_nkhonde = 0 if demo_q4 != 37 & demo_q4 != .

gen resp_sena = 1 if demo_q4 == 43
replace resp_sena = 0 if demo_q4 != 43 & demo_q4 != .

gen resp_senga = 1 if demo_q4 == 44
replace resp_senga = 0 if demo_q4 != 44 & demo_q4 != .

gen resp_sukwa = 1 if demo_q4 == 47
replace resp_sukwa = 0 if demo_q4 != 47 & demo_q4 != .

gen resp_tonga = 1 if demo_q4 == 51
replace resp_tonga = 0 if demo_q4 != 51 & demo_q4 != .

gen resp_tumbuka = 1 if demo_q4 == 52
replace resp_tumbuka = 0 if demo_q4 != 52 & demo_q4 != .

gen resp_yao = 1 if demo_q4 == 55
replace resp_yao = 0 if demo_q4 != 55 & demo_q4 != .

*gen resp_no_eth = 1 if demo_q4 == "Don't Know/Refuse to answer" | demo_q4 == "Does not identify in those terms (Malawian only)"
*replace resp_no_eth = 0 if demo_q4 != "Don't Know/Refuse to answer" & demo_q4 != "Does not identify in those terms (Malawian only)" & q_103 != ""


*Zambia ethnicity
tab demo_q4 if zam_border == 1

gen resp_bemba = 1 if demo_q4 == 1
replace resp_bemba = 0 if demo_q4 != 1 & demo_q4 != .

gen resp_bisa = 1 if demo_q4 == 2
replace resp_bisa = 0 if demo_q4 != 2 & demo_q4 != .

gen resp_bwile = 1 if demo_q4 == 3
replace resp_bwile = 0 if demo_q4 != 3 & demo_q4 != .

gen resp_english = 1 if demo_q4 == 7
replace resp_english = 0 if demo_q4 != 7 & demo_q4 != .

gen resp_ila = 1 if demo_q4 == 9
replace resp_ila = 0 if demo_q4 != 9 & demo_q4 != .

gen resp_kaonde = 1 if demo_q4 == 12
replace resp_kaonde = 0 if demo_q4 != 12 & demo_q4 != .

gen resp_kunda = 1 if demo_q4 == 15
replace resp_kunda = 0 if demo_q4 != 15 & demo_q4 != .

gen resp_lala = 1 if demo_q4 == 16
replace resp_lala = 0 if demo_q4 != 16 & demo_q4 != .

gen resp_lamba = 1 if demo_q4 == 17
replace resp_lamba = 0 if demo_q4 != 17 & demo_q4 != .

gen resp_lenje = 1 if demo_q4 == 19
replace resp_lenje = 0 if demo_q4 != 19 & demo_q4 != .

gen resp_lozi = 1 if demo_q4 == 21
replace resp_lozi = 0 if demo_q4 != 21 & demo_q4 != .

gen resp_lunda = 1 if demo_q4 == 23
replace resp_lunda = 0 if demo_q4 != 23 & demo_q4 != .

gen resp_lungu = 1 if demo_q4 == 24
replace resp_lungu = 0 if demo_q4 != 24 & demo_q4 != .

gen resp_luvale = 1 if demo_q4 == 26
replace resp_luvale = 0 if demo_q4 != 26 & demo_q4 != .

gen resp_mambwe = 1 if demo_q4 == 27
replace resp_mambwe = 0 if demo_q4 != 27 & demo_q4 != .

gen resp_namwanga = 1 if demo_q4 == 33
replace resp_namwanga = 0 if demo_q4 != 33 & demo_q4 != .

gen resp_nsenga = 1 if demo_q4 == 39
replace resp_nsenga = 0 if demo_q4 != 39 & demo_q4 != .

gen resp_nyanja = 1 if demo_q4 == 40
replace resp_nyanja = 0 if demo_q4 != 40 & demo_q4 != .

gen resp_nyika = 1 if demo_q4 == 41
replace resp_nyika = 0 if demo_q4 != 41 & demo_q4 != .

gen resp_soli = 1 if demo_q4 == 45
replace resp_soli = 0 if demo_q4 != 45 & demo_q4 != .

gen resp_tabwa = 1 if demo_q4 == 48
replace resp_tabwa = 0 if demo_q4 != 48 & demo_q4 != .

*gen resp_tonga = 1 if demo_q4 == 51
*replace resp_tonga = 0 if demo_q4 != 51 & demo_q4 != .

gen resp_ushi = 1 if demo_q4 == 54
replace resp_ushi = 0 if demo_q4 != 54 & demo_q4 != .


*recode "others" that fit in the above groupings and code all others as "OTHER"
tab demo_q4_O if mal_border == 1
tab demo_q4_O if zam_border == 1

replace resp_bemba = 1 if demo_q4_O == "Bemba"
replace resp_ndali = 1 if demo_q4_O == "Chindali"
replace resp_ndali = 1 if demo_q4_O == "M'ndali"
replace resp_mambwe = 1 if demo_q4_O == "Mambwe"
replace resp_mambwe = 1 if demo_q4_O == "Mmambwe"
replace resp_nyika = 1 if demo_q4_O == "Mnyika"
replace resp_namwanga = 1 if demo_q4_O == "Munamwanga"
replace resp_nyika = 1 if demo_q4_O == "Munyika"
replace resp_sukwa = 1 if demo_q4_O == "Musukwa"
replace resp_namwanga = 1 if demo_q4_O == "Mwinamwanga"
replace resp_namwanga = 1 if demo_q4_O == "Namwagwa"
replace resp_namwanga = 1 if demo_q4_O == "Namwanga"
replace resp_namwanga = 1 if demo_q4_O == "Namwanga (Zambian language)"
replace resp_ndali = 1 if demo_q4_O == "Ndali"
replace resp_ngoni = 1 if demo_q4_O == "Ngoni"
replace resp_namwanga = 1 if demo_q4_O == "Nyamwanga"
*replace resp_nyanja = 1 if demo_q4_O == "Nyanja"
replace resp_nyika = 1 if demo_q4_O == "Nyika"
replace resp_nyika = 1 if demo_q4_O == "Nyika/Nyiha"
replace resp_sukwa = 1 if demo_q4_O == "Sukwa"
replace resp_lambya = 1 if demo_q4_O == "lambya"
replace resp_mambwe = 1 if demo_q4_O == "mabwe"
replace resp_mambwe = 1 if demo_q4_O == "mambwe"
replace resp_nyika = 1 if demo_q4_O == "mnyika"
replace resp_namwanga = 1 if demo_q4_O == "mwinamwanga"
replace resp_namwanga = 1 if demo_q4_O == "namwanga"
replace resp_ndali = 1 if demo_q4_O == "ndali"
replace resp_namwanga = 1 if demo_q4_O == "nyamwanga"
replace resp_nyika = 1 if demo_q4_O == "nyika"
replace resp_nyika = 1 if demo_q4_O == "Mnyiha"
replace resp_nyika = 1 if demo_q4_O == "Munyiha"
replace resp_nyika = 1 if demo_q4_O == "Nyiha"
replace resp_nyika = 1 if demo_q4_O == "mnyiha"
replace resp_nyika = 1 if demo_q4_O == "nyiha"

replace resp_lambya = 1 if demo_q4_O == "Lambia"
replace resp_lambya = 1 if demo_q4_O == "Labiya"
replace resp_lambya = 1 if demo_q4_O == "Lambiya"
replace resp_lambya = 1 if demo_q4_O == "Lambya"
replace resp_lambya = 1 if demo_q4_O == "Mulambya"
replace resp_ndali = 1 if demo_q4_O == "Mundali"
replace resp_ushi = 1 if demo_q4_O == "Mwaushi"
replace resp_tabwa = 1 if demo_q4_O == "Tabwa"
replace resp_tonga = 1 if demo_q4_O == "Tonga from Malawi."
replace resp_kunda = 1 if demo_q4_O == "chikunda"
replace resp_lambya = 1 if demo_q4_O == "labia"
replace resp_lambya = 1 if demo_q4_O == "labya"
replace resp_lambya = 1 if demo_q4_O == "lambai"
replace resp_lambya = 1 if demo_q4_O == "lambia"
replace resp_lambya = 1 if demo_q4_O == "lambiya"
*replace resp_lambya = 1 if demo_q4_O == "lambya"
replace resp_lungu = 1 if demo_q4_O == "mulungu"
replace resp_nyika = 1 if demo_q4_O == "munyiha"
replace resp_ngoni = 1 if demo_q4_O == "nguni"
replace resp_tumbuka = 1 if demo_q4_O == "tubuka"


gen resp_other = 1 if demo_q4 == 56 & resp_chewa == 0 & resp_lambya == 0 & resp_lomwe == 0 & resp_manganja == 0 & resp_ndali == 0 & resp_ngoni == 0 & resp_nkhonde == 0 & ///
resp_sena == 0 & resp_senga == 0 & resp_sukwa == 0 & resp_tonga == 0 & resp_tumbuka == 0 & resp_yao == 0 & resp_bemba == 0 & resp_bisa == 0 & ///
resp_bwile == 0 & resp_english == 0 & resp_ila == 0 & resp_kaonde == 0 & resp_kunda == 0 & resp_lala == 0 & resp_lamba == 0 & resp_lenje == 0 & ///
resp_lozi == 0 & resp_lunda == 0 & resp_lungu == 0 & resp_luvale == 0 & resp_mambwe == 0 & resp_namwanga == 0 & resp_nsenga == 0 & ///
resp_nyika == 0 & resp_soli == 0 & resp_tabwa == 0 & resp_ushi == 0

replace resp_other = 0 if demo_q4 != 56 & demo_q4 != . & (resp_chewa == 1 | resp_lambya == 1 | resp_lomwe == 1 | resp_manganja == 1 | resp_ndali == 1 | resp_ngoni == 1 | resp_nkhonde == 1 | ///
resp_sena == 1 | resp_senga == 1 | resp_sukwa == 1 | resp_tonga == 1 | resp_tumbuka == 1 | resp_yao == 1 | resp_bemba == 1 | resp_bisa == 1 | ///
resp_bwile == 1 | resp_english == 1 | resp_ila == 1 | resp_kaonde == 1 | resp_kunda == 1 | resp_lala == 1 | resp_lamba == 1 | resp_lenje == 1 | ///
resp_lozi == 1 | resp_lunda == 1 | resp_lungu == 1 | resp_luvale == 1 | resp_mambwe == 1 | resp_namwanga == 1 | resp_nsenga == 1 | ///
resp_nyika == 1 | resp_soli == 1 | resp_tabwa == 1 | resp_ushi == 1)

replace resp_other = 0 if resp_other == . & resp_chewa != .


*check to see if we think the person got non-co-ethnic but really got co-ethnic

gen exp_co_ethnic = 1 if lexp_q5 == 1
replace exp_co_ethnic = 0 if lexp_q5 == 2

replace exp_co_ethnic = 1 if exp_chewa == 1 & resp_chewa == 1
replace exp_co_ethnic = 1 if exp_tumbuka == 1 & resp_tumbuka == 1
replace exp_co_ethnic = 1 if exp_ngoni == 1 & resp_ngoni == 1
replace exp_co_ethnic = 1 if exp_lambya == 1 & resp_lambya == 1
replace exp_co_ethnic = 1 if exp_yao == 1 & resp_yao == 1
replace exp_co_ethnic = 1 if exp_lomwe == 1 & resp_lomwe == 1
replace exp_co_ethnic = 1 if exp_senga == 1 & resp_senga == 1
replace exp_co_ethnic = 1 if exp_ndali == 1 & resp_ndali == 1
replace exp_co_ethnic = 1 if exp_namwanga == 1 & resp_namwanga == 1
replace exp_co_ethnic = 1 if exp_bemba == 1 & resp_bemba == 1
replace exp_co_ethnic = 1 if exp_bisa == 1 & resp_bisa == 1
replace exp_co_ethnic = 1 if exp_nyika == 1 & resp_nyika == 1
*replace exp_co_ethnic = 1 if exp_nyanja == 1 & resp_nyanja == 1


*those with title from the government or some other landlord (rather than via chief etc.) 
gen have_gov_title = 1 if land_q9 == 2 & (land_q10 == 1 | land_q10 == 2 | land_q10 == 6)
replace have_gov_title = 0 if land_q9 == 1 /* those without land title */
replace have_gov_title = 0 if land_q9 == 3 /* those who do not own any land */
replace have_gov_title = 0 if land_q9 == 2 & (land_q10 == 3 | land_q10 == 4 | land_q10 == 5 | land_q10 == 7) /* those with traditional land title */


*exp_maj_eth
*now indicator for whether or not the hypothetical neighbor is from the majority or plurality
gen exp_maj_eth = .

foreach i in chewa lambya lomwe ndali ngoni ///
senga tumbuka yao namwanga bemba bisa nyika {
	replace exp_maj_eth = 1 if exp_`i' == 1 & majority == "`i'"
	replace exp_maj_eth = 0 if exp_`i' == 0 & majority == "`i'"
	}
*

*shared identities
*exp_co_wealth exp_co_migrant exp_co_age exp_co_gender

gen exp_co_wealth = .

replace exp_co_wealth = 1 if demo_q25 == 1 & exp_highinc == 1
replace exp_co_wealth = 1 if demo_q25 == 2  & exp_highinc == 1
replace exp_co_wealth = 0 if demo_q25 == 1 & exp_highinc == 0
replace exp_co_wealth = 0 if demo_q25 == 2  & exp_highinc == 0

replace exp_co_wealth = 1 if demo_q25 == 3 & exp_highinc == 0 & exp_lowinc == 0
replace exp_co_wealth = 0 if demo_q25 == 3 & (exp_highinc == 1 | exp_lowinc == 1)

replace exp_co_wealth = 1 if demo_q25 == 4 & exp_lowinc == 1
replace exp_co_wealth = 0 if demo_q25 == 4 & exp_lowinc == 0

gen exp_co_migrant = 1 if demo_q10 == 1 & exp_migrant == 1
replace exp_co_migrant = 1 if demo_q10 != 1 & demo_q10 != 6 & demo_q10 != . & exp_migrant == 0
replace exp_co_migrant = 0 if demo_q10 == 1 & exp_migrant == 0
replace exp_co_migrant = 0 if demo_q10 != 1 & demo_q10 != 6 & demo_q10 != . & exp_migrant == 1

gen exp_co_age = 1 if exp_age50 == 1 & demo_q2 >=38
replace exp_co_age = 0 if exp_age50 == 1 & demo_q2 <38
replace exp_co_age = 1 if exp_age50 == 0 & demo_q2 <=37
replace exp_co_age = 0 if exp_age50 == 0 & demo_q2 >37

gen exp_co_gender = 1 if exp_male == 1 & demo_q1 == 1
replace exp_co_gender = 0 if exp_male == 1 & demo_q1 == 2
replace exp_co_gender = 0 if exp_male == 0 & demo_q1 == 1
replace exp_co_gender = 1 if exp_male == 0 & demo_q1 == 2


*respondent characteristics
resp_highinc resp_lowinc resp_migrant age resp_male

gen resp_highinc = .
replace resp_highinc = 1 if demo_q25 == 1 
replace resp_highinc = 1 if demo_q25 == 2
replace resp_highinc = 0 if demo_q25 == 3
replace resp_highinc = 0 if demo_q25 == 4

gen resp_lowinc = .
replace resp_lowinc = 1 if demo_q25 == 4 
replace resp_lowinc = 0 if demo_q25 == 3
replace resp_lowinc = 0 if demo_q25 == 1 
replace resp_lowinc = 0 if demo_q25 == 2

gen resp_migrant = 1 if demo_q10 == 1
replace resp_migrant = 0 if demo_q10 != 1 & demo_q10 != 6 & demo_q10 != .

rename demo_q2 age

gen resp_male = 1 if demo_q1 == 1
replace resp_male = 0 if demo_q1 == 2


*/


lab var single_male "Male Head (Unmarried)"
lab var single_female "Female Head (Unmarried)"
lab var age "Age"
lab var resp_migrant "New Migrant"
lab var resp_migrant10 "Migrant (10 years)"
lab var outsider "Feels Like an Outsider"
lab var local "Considered Local" 
lab var native "Born in Village"
lab var resp_highinc "High"
lab var resp_lowinc "Low"
lab var cash_income "Earns a Cash Income"
lab var primary_schooling "Primary"
lab var secondary_schooling "Any Secondary"
lab var post_secondary_schooling "Any Post-Secondary"
lab var secondaryplus "Secondary or Post-Secondary"
lab var not_obligated "Does Not Feel Obligation to Others"
lab var aglanduse "Agricultural Land Use"
lab var local_obligation_to_help "Local Obligation" 
lab var not_contribute "No Contributions in the Past Year"
lab var contributed "Contributed in the Past Year"
lab var land_size "Size of Land (hectares)"
lab var land_not_agriculture "Primary use of Land NOT Agriculture"
lab var aglanduse "Agricultural Land"
lab var Acquiredfamily "Inherited Land"
lab var Purchased "Purchased Land"
lab var resp_maj_eth "Majority Ethnic Group"


********** Article **********


*** Figure 1 ***

*Figure 1a
* countries pooled, restricted, individual cooperation outcome
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
est sto Trust_main, title(Ind. Coop.)
*the plot
coefplot Trust_main, drop(_cons) xline(0) omitted baselevels msymbol(d)  ///
levels(95)  xtitle({bf:Estimated Change in Perceived Individ. Coop.}, size(small)) legend(off) xscale(range(-.15 .05)) xlabel(-.15(.05).05) ///
headings(exp_title = "{bf:Title}" exp_highinc = "{bf:Income}" exp_migrant = "{bf:Migration Status}" exp_age50 = "{bf:Age}" exp_male = "{bf:Gender}" exp_co_ethnic = "{bf:Ethnicity}" mal_border = "{bf:Sample}", labsize(2.5)) ///
graphregion(color(white)) grid(between glcolor(white)) legend(label(1 "Success Index") row(1)  size(small)) ylab(, labs(2.5)) xlab(, labs(2.5))
*graph export trust_base_pool.pdf, replace
*graph save trust_base_pool.gph, replace

*Fgure 1b
* countries pooled, restricted, community cooperation outcome
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
est sto Help_main, title(Comm. Coop.)
*the plot
coefplot Help_main, drop(_cons) xline(0) omitted baselevels msymbol(d)  ///
levels(95)  xtitle({bf:Estimated Change in Perceived Comm. Coop.}, size(small)) legend(off) xscale(range(-.15 .05)) xlabel(-.15(.05).05) ///
headings(exp_title = "{bf:Title}" exp_highinc = "{bf:Income}" exp_migrant = "{bf:Migration Status}" exp_age50 = "{bf:Age}" exp_male = "{bf:Gender}" exp_co_ethnic = "{bf:Ethnicity}" mal_border = "{bf:Sample}", labsize(2.5)) ///
graphregion(color(white)) grid(between glcolor(white)) legend(label(1 "Success Index") row(1)  size(small)) ylab(, labs(2.5)) xlab(, labs(2.5))
*graph export help_base_pool.pdf, replace
*graph save help_base_pool.gph, replace



*** Table 1 ***

*Malawi Restricted (Customary Land Rights) (4)
*individual
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if mal_border == 1 & have_gov_title == 0, cluster(sqkm)
*community
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if mal_border == 1 & have_gov_title == 0, cluster(sqkm)

*Zambia Restricted (Customary Land Rights) (5)
*individual
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if zam_border == 1 & have_gov_title == 0, cluster(sqkm)
*community
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if zam_border == 1 & have_gov_title == 0, cluster(sqkm)

*Country Pooled Unrestricted (Mixed Land Rights) (1)
*individual
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border, cluster(sqkm)
*community
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border, cluster(sqkm)

*Malawi Unrestricted (Mixed Land Rights) (2)
*individual
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if mal_border == 1, cluster(sqkm)
*community; NOTE: this was rounded wrong in previous version of paper; -0.031 rather than -0.030
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if mal_border == 1, cluster(sqkm)

*Zambia Unrestricted (Mixed Land Rights) (3)
*individual; NOTE: this was rounded wrong in previous version of paper; -0.027 rather than -0.028
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if zam_border == 1, cluster(sqkm)
*community
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if zam_border == 1, cluster(sqkm)

*Ethnicity by village maj/min (15)
*individual
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_maj_eth mal_border if have_gov_title == 0, cluster(sqkm)
*community
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_maj_eth mal_border if have_gov_title == 0, cluster(sqkm)

*Shared identities (16)
*individual
reg trust_pay_back exp_title exp_co_wealth exp_co_migrant exp_co_age exp_co_gender ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
*community
reg help_collect_donations exp_title exp_co_wealth exp_co_migrant exp_co_age exp_co_gender ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)

*Shared identities w/respondent characteristics (16)
*individual; NOTE: this was rounded wrong in previous version of paper; -0.039 rather than -0.040
reg trust_pay_back exp_title exp_co_wealth exp_co_migrant exp_co_age exp_co_gender ///
exp_co_ethnic ///
resp_highinc resp_lowinc resp_migrant age resp_male ///
resp_lambya resp_lomwe resp_manganja resp_ndali resp_ngoni resp_nkhonde ///
resp_sena resp_senga resp_sukwa resp_tonga resp_tumbuka resp_yao resp_other ///
if have_gov_title == 0, cluster(sqkm)
*community
reg help_collect_donations exp_title exp_co_wealth exp_co_migrant exp_co_age exp_co_gender ///
exp_co_ethnic ///
resp_highinc resp_lowinc resp_migrant age resp_male ///
resp_lambya resp_lomwe resp_manganja resp_ndali resp_ngoni resp_nkhonde ///
resp_sena resp_senga resp_sukwa resp_tonga resp_tumbuka resp_yao resp_other ///
if have_gov_title == 0, cluster(sqkm)

*Titling treatment x Malawi dummy (18)
*individual
reg trust_pay_back exp_title##mal_border exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if have_gov_title == 0, cluster(sqkm)
*community
reg help_collect_donations exp_title##mal_border exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if have_gov_title == 0, cluster(sqkm)



*** Figure 2 ***

*Follow Headman/Woman Mechanism
reg neigh_follow_hmw exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
est sto pool_hmw

*Share Well Mechanism
reg neigh_let_use_well exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
est sto pool_well

*Observe Way of Life Mechanism
reg neigh_obs_way_life exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
est sto pool_obs

*plot
coefplot pool_hmw pool_well pool_obs, drop(_cons) xline(0) omitted baselevels msymbol(d)  ///
levels(95)  xtitle({bf:Estimated Effect on Mechanism}, size(small)) ///
xscale(range(-.15 .15)) xlabel(-.15(.05).15) ///
headings(exp_title = "{bf:Title}" exp_highinc = "{bf:Income}" exp_migrant = "{bf:Migration Status}" exp_age50 = "{bf:Age}" exp_male = "{bf:Gender}" exp_co_ethnic = "{bf:Ethnicity}" mal_border = "{bf:Sample}", labsize(2.5)) ///
graphregion(color(white)) grid(between glcolor(white)) legend(label(1 "Success Index") row(1)  size(small)) ylab(, labs(2.5)) xlab(, labs(2.5))
*graph save pool_mech.gph, replace
*graph export pool_mech.pdf, replace


********** Appendices **********

*** Appendix B ***

*Table B.1
*outcome variables
sum trust_pay_back help_collect_donations neigh_follow_hmw neigh_obs_way_life neigh_let_use_well
*treatments
sum exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male exp_co_ethnic ///
exp_maj_eth exp_co_wealth exp_co_migrant exp_co_age exp_co_gender
*controls
sum resp_highinc resp_lowinc resp_migrant age resp_male elf

*Figure B.1
*see "figureb1.do"

*Table B.2
*Individ. (OLS)
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
*Individ. (logit)
logit trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
*Comm. (OLS)
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
*Comm. (logit)
logit help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)

*Table B.3
* Verticle (Follow Headman/Woman Mechanism)
reg neigh_follow_hmw exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
*Horizontal (Share Well Mechanism)
reg neigh_let_use_well exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
*Diffuse (Observe Way of Life Mechanism)
reg neigh_obs_way_life exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)


*** Appendix C ***

*Table C.1
*Malawi Individ.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if mal_border == 1 & have_gov_title == 0, cluster(sqkm)
*Malawi Comm.
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if mal_border == 1 & have_gov_title == 0, cluster(sqkm)
*Zambia Individ.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if mal_border == 0 & have_gov_title == 0, cluster(sqkm)
*Zambia Comm.
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if mal_border == 0 & have_gov_title == 0, cluster(sqkm)

*Table C.2
*Individ. (OLS)
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border, cluster(sqkm)
*Individ. (logit)
logit trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border, cluster(sqkm)
*Comm. (OLS)
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border, cluster(sqkm)
*Comm. (logit)
logit help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border, cluster(sqkm)

*Table C.3
*Malawi full models
*Individ. (OLS)
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_lambya exp_lomwe exp_ndali exp_ngoni exp_senga exp_tumbuka ///
exp_yao if mal_border == 1, cluster(sqkm)
*Individ. (logit)
logit trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_lambya exp_lomwe exp_ndali exp_ngoni exp_senga exp_tumbuka ///
exp_yao if mal_border == 1, cluster(sqkm)
*Comm. (OLS)
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_lambya exp_lomwe exp_ndali exp_ngoni exp_senga exp_tumbuka ///
exp_yao if mal_border == 1, cluster(sqkm)
*Comm. (logit)
logit help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_lambya exp_lomwe exp_ndali exp_ngoni exp_senga exp_tumbuka ///
exp_yao if mal_border == 1, cluster(sqkm)


*Table C.4 
*Zambia full models
*Individ (OLS)
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_namwanga exp_bemba exp_senga exp_ngoni exp_chewa exp_tumbuka ///
exp_nyika if zam_border == 1, cluster(sqkm)
*Individ (logit)
logit trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_namwanga exp_bemba exp_senga exp_ngoni exp_chewa exp_tumbuka ///
exp_nyika if zam_border == 1, cluster(sqkm)
*Comm. (OLS)
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_namwanga exp_bemba exp_senga exp_ngoni exp_chewa exp_tumbuka ///
exp_nyika if zam_border == 1, cluster(sqkm)
*Comm. (logit)
logit help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_namwanga exp_bemba exp_senga exp_ngoni exp_chewa exp_tumbuka ///
exp_nyika if zam_border == 1, cluster(sqkm)


*Table C.5
*(7) Sub-sample by high/low ELF
*low ELF, Individ.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & elf <= .39, cluster(sqkm)
*high ELF, Individ.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & elf > .39, cluster(sqkm)
*low ELF, Comm.
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & elf <= .39, cluster(sqkm)
*high ELF, Comm.
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & elf > .39, cluster(sqkm)

*(9) Sub-sample by patriarchy index
*low patriarchy, individ.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male exp_co_ethnic mal_border ///
if have_gov_title == 0 & prop_one_inf_woman < .1, cluster(sqkm)
*high patriarchy, individ. 
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male exp_co_ethnic mal_border  ///
if have_gov_title == 0  & prop_one_inf_woman >= .1, cluster(sqkm)
*low patriarchy, comm. 
 reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male exp_co_ethnic mal_border  ///
if have_gov_title == 0 & prop_one_inf_woman < .1, cluster(sqkm)
*high patriarchy, comm. 
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male exp_co_ethnic mal_border  ///
if have_gov_title == 0  & prop_one_inf_woman >= .1, cluster(sqkm)

*(10) Sub-sample by patrilineal/matrilineal
*not maj pat, individ.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male exp_co_ethnic mal_border ///
if have_gov_title == 0 & majority_mat==1, cluster(sqkm)
*maj pat, individ.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male exp_co_ethnic mal_border  ///
if have_gov_title == 0  & majority_pat==1, cluster(sqkm)
*not maj pat, comm.
reg help_collect_donations  exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male exp_co_ethnic mal_border ///
if have_gov_title == 0 & majority_mat==1, cluster(sqkm)
*maj pat, comm.
reg help_collect_donations  exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male exp_co_ethnic mal_border ///
if have_gov_title == 0 & majority_pat==1, cluster(sqkm)

*(11) Sub-sample by age
*young, individ.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & older2 == 0, cluster(sqkm)
*old, individ.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & older2 == 1, cluster(sqkm)
*young, comm.
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & older2 == 0, cluster(sqkm)
*old, comm.
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & older2 == 1, cluster(sqkm)

*(12) Sub-sample by nativity
*migrant, individ.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & native == 0, cluster(sqkm)
*born in village, individ.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & native == 1, cluster(sqkm)
*migrant, comm.
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & native == 0, cluster(sqkm)
*born in village, comm.
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & native == 1, cluster(sqkm)

*(13) Sub-sample by by inheritance of land
*not fam inherit, indivd.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & Acquiredfamily == 0, cluster(sqkm)
*fam inherit, individ.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & Acquiredfamily == 1, cluster(sqkm)
*not fam inherit, comm.
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & Acquiredfamily == 0, cluster(sqkm)
*fam inherit, comm.
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & Acquiredfamily == 1, cluster(sqkm)

*(14) Sub-sample by high/low rates of titling
*low titling, individ.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & prop_titlers <= .06, cluster(sqkm)
*high titling, individ.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & prop_titlers > .06, cluster(sqkm)
*low titling, comm.
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & prop_titlers <= .06, cluster(sqkm)
*high titling, comm.
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0 & prop_titlers > .06, cluster(sqkm)


*Table C.6
*Title x high income interaction; individ. ... some rounding issues in original table
reg trust_pay_back exp_title##exp_highinc exp_lowinc exp_migrant exp_age50 exp_male exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
*Title x high income interaction; comm. ... some rounding issues, missing single star on interaction term in original table and typo on sample size
reg help_collect_donations exp_title##exp_highinc exp_lowinc exp_migrant exp_age50 exp_male exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)

*Title x migrant interaction; individ.
reg trust_pay_back exp_title##exp_migrant exp_highinc exp_lowinc exp_age50 exp_male exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
*Title x migrant interaction; comm.
reg help_collect_donations exp_title##exp_migrant exp_highinc exp_lowinc exp_age50 exp_male exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)

*Title x 50 yo interaction; individ.
reg trust_pay_back exp_title##exp_age50 exp_highinc exp_lowinc exp_migrant  exp_male exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
*Title x 50 yo interaction; comm.
reg help_collect_donations exp_title##exp_age50 exp_highinc exp_lowinc exp_migrant  exp_male exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)

*Title x male interaction; individ.
reg trust_pay_back exp_title##exp_male exp_highinc exp_lowinc exp_migrant exp_age50 exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
*Title x male interaction; comm.
reg help_collect_donations exp_title##exp_male exp_highinc exp_lowinc exp_migrant exp_age50 exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)

*Title x co-ethnic interaction; individ.
reg trust_pay_back exp_title##exp_co_ethnic exp_highinc exp_lowinc exp_migrant exp_age50 exp_male mal_border if have_gov_title == 0, cluster(sqkm)
*Title x co-ethnic interaction; comm.
reg help_collect_donations exp_title##exp_co_ethnic exp_highinc exp_lowinc exp_migrant exp_age50 exp_male mal_border if have_gov_title == 0, cluster(sqkm)


*** Appendix D ***

*Table D1 
*Malawi; minor rounding error for government title
sum have_gov_title single_male single_female  resp_highinc resp_lowinc primary_schooling  ///
 secondaryplus age  land_size aglanduse Acquiredfamily resp_migrant10 ///
 native resp_maj_eth contributed local_obligation_to_help if mal_border == 1

*Table D2 
*Zambia; minor roudning error for conribued in the past year
sum have_gov_title single_male single_female  resp_highinc resp_lowinc primary_schooling  ///
 secondaryplus age  land_size aglanduse Acquiredfamily resp_migrant10 ///
 native resp_maj_eth contributed local_obligation_to_help if mal_border == 0
 
*Table D3
*pooled, with title; some minor rounding errors and typos in original table for migrant and land size
sum  single_male single_female  resp_highinc resp_lowinc primary_schooling  ///
 secondaryplus age  land_size aglanduse Acquiredfamily resp_migrant10 ///
 native resp_maj_eth contributed local_obligation_to_help if  have_gov_title==1

*Table D4
*pooled, without title; minor rounding error for ag. land
sum  single_male single_female  resp_highinc resp_lowinc primary_schooling  ///
 secondaryplus age  land_size aglanduse Acquiredfamily resp_migrant10 ///
 native resp_maj_eth contributed local_obligation_to_help if have_gov_title==0

*Figure D1

*Malawi D1(a)
logit have_gov_title single_male single_female  resp_highinc resp_lowinc primary_schooling  ///
 secondaryplus age  land_size aglanduse Acquiredfamily resp_migrant10 ///
 native resp_maj_eth contributed local_obligation_to_help if mal_border == 1 , cluster(sqkm)
est sto Malawi

logit have_gov_title single_male single_female  resp_highinc resp_lowinc primary_schooling  ///
 secondaryplus age  land_size aglanduse Acquiredfamily resp_migrant10 ///
 native resp_maj_eth if mal_border == 1 , cluster(sqkm)
est sto Malawi2

coefplot Malawi Malawi2, drop(_cons) xline(0) omitted baselevels msymbol(d)  ///
levels(95)  xtitle({bf:Predicting Having a Title}, size(small)) ///
legend(off) xscale(range(-1.5 1.5)) xlabel(-1.5(.5)1.5) ///
headings(single_male = "{bf:HH Gender/Marriage Status}" age = "{bf:}" resp_migrant10 = "{bf:}" ///
aglanduse = "{bf:}" resp_highinc = "{bf:Income}"  primary_schooling = "{bf:Education}"  ///
land_size = "{bf:}" native="{bf:}" Acquiredfamily = "{bf:}"  resp_maj_eth = "{bf:}" contributed= "{bf:}" local_obligation_to_help= "{bf:}", ///
labsize(2.5)) graphregion(color(white)) grid(between glcolor(white)) ///
legend(label(1 "Success Index") row(1)  size(small)) ylab(, labs(2.5)) xlab(, labs(2.5)) ysize(6.5)

*Zambia D1(b)
logit have_gov_title single_male single_female   resp_highinc resp_lowinc primary_schooling  ///
 secondaryplus age  land_size aglanduse Acquiredfamily resp_migrant10 ///
 native resp_maj_eth contributed local_obligation_to_help  if zam_border == 1 , cluster(sqkm)
est sto Zambia

logit have_gov_title single_male single_female   resp_highinc resp_lowinc primary_schooling  ///
 secondaryplus age  land_size aglanduse Acquiredfamily resp_migrant10 ///
 native resp_maj_eth if zam_border == 1 , cluster(sqkm)
est sto Zambia2

coefplot Zambia Zambia2, drop(_cons) xline(0) omitted baselevels msymbol(d)  ///
levels(95)  xtitle({bf:Predicting Having a Title}, size(small)) ///
legend(off) xscale(range(-1.5 1.5)) xlabel(-1.5(.5)1.5) ///
headings(single_male = "{bf:HH Gender/Marriage Status}" age = "{bf:}" resp_migrant10 = "{bf:}" ///
aglanduse = "{bf:}" resp_highinc = "{bf:Income}"  primary_schooling = "{bf:Education}"  ///
land_size = "{bf:}" native="{bf:}" Acquiredfamily = "{bf:}"  resp_maj_eth = {bf:} contributed= "{bf:}" local_obligation_to_help= "{bf:}", ///
labsize(2.5)) graphregion(color(white)) grid(between glcolor(white)) ///
legend(label(1 "Success Index") row(1)  size(small)) ylab(, labs(2.5)) xlab(, labs(2.5)) ysize(6.5)


*** Appendix E ***

*Table E1
*pooled, individ.
logit trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
*pooled, comm.
logit help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
*malawi, individ.
logit trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if mal_border == 1 & have_gov_title == 0, cluster(sqkm)
*malawi, comm.
logit help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if mal_border == 1 & have_gov_title == 0, cluster(sqkm)
*zambia, individ.
logit trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if mal_border == 0 & have_gov_title == 0, cluster(sqkm)
*zambia, comm.
logit help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic if mal_border == 0 & have_gov_title == 0, cluster(sqkm)


*Table E2
*Vertical; Follow Headman/Woman Mechanism
logit neigh_follow_hmw exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
*Horizontal; Share Well Mechanism
logit neigh_let_use_well exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)
*Diffuse; Observe Way of Life Mechanism
logit neigh_obs_way_life exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 0, cluster(sqkm)


*Table E3
*pooled, only WITH title, individ.
reg trust_pay_back exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 1, cluster(sqkm)
*pooled, only WITH title comm.
reg help_collect_donations exp_title exp_highinc exp_lowinc exp_migrant exp_age50 exp_male ///
exp_co_ethnic mal_border if have_gov_title == 1, cluster(sqkm)


*Table E4
*this table is replicated by simply subtracting the respective coefficients 
*(which come from the models reported in Table B3):
di -.080 - -.039
di -.080 - -.029
di -.039 - -.029

*And then calculating z-scores for these differences using Clogg's method:
*z = (B1 - B2) / √(seB1^2 + seB2^2)
*z score threashold is 1.96 for .05 level in two-tailed test

*hmw v well
di (-.0803396 - - .0391765) / sqrt((.0092414*.0092414) + (.0091519*.0091519))
*-3.165

*hmw v obs
di (-.0803396 - - .0291899) / sqrt((.0092414*.0092414) + (.0122279*.0122279))
*-3.337

* well v obs
di (-.0391765 - - .0291899) / sqrt((.0091519*.0091519) + (.0122279*.0122279))
*-0.654


log close









